
package cnhy.salary.controller;

import io.swagger.annotations.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.security.access.prepost.PreAuthorize;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import lombok.*;
import com.ruoyi.common.core.page.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import cnhy.salary.domain.OutputRecord;
//import cnhy.salary.service.OutputRecordService;
import ling.common.*;
import ling.common.domain.*;

 /** 产出记录 控制层
 * @author : He-LiangLiang@Outlook.com
 * @date : 2025-5-26
 */
@Api(tags = "产出记录 功能接口")
@RestController
@RequestMapping("/salary/OutputRecord")
public class OutputRecordController extends EQueryController<OutputRecord>{
    

    
    @ApiOperation("详情")
    @PreAuthorize("@ps.any(@pay.outputRecord.query)")
    @GetMapping(value = "/{id}")
    public Result<OutputRecord> getInfo(@PathVariable("id") Long id)
    {
       return super.getInfo(id);
    }
    
    @ApiOperation("分页列表")
    @PreAuthorize("@ps.any(@pay.outputRecord.list)")
    @GetMapping("list")
    public ResultRows<OutputRecord> list(OutputRecord dto, PageDomain pageRequest) {
        return queryPage(dto,pageRequest);
    }
    
    @ApiOperation("新增")
    @PreAuthorize("@ps.any(@pay.outputRecord.add)")
    @Log(title = "产出记录", businessType = BusinessType.INSERT)
    @PostMapping
    public Result add(@Validated @RequestBody OutputRecord entity){
       return super.add(entity);
    }
    
    @ApiOperation("删除")
    @PreAuthorize("@ps.any(@pay.outputRecord.remove)")
    @Log(title = "产出记录", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public Result remove(@PathVariable("ids") Long[] ids){
        return super.remove(Arrays.stream(ids).toArray());
    }
    
    @ApiOperation("编辑")
    @PreAuthorize("@ps.any(@pay.outputRecord.edit)")
    @Log(title = "产出记录", businessType = BusinessType.UPDATE)
    @PutMapping
    public  Result edit(@Validated @RequestBody OutputRecord entity){
        return super.edit(entity);
    }
    
    @ApiOperation("导出")
    @PreAuthorize("@ps.any(@pay.outputRecord.export)")
    @Log(title = "产出记录", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(OutputRecord entity, PageDomain pageRequest,HttpServletResponse response)
    {
        super.export(entity,pageRequest,null,response);
    }
}